/*******************************************************************************
 * Copyright (c) 2010, 2030 www.mahao.cn
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package cn.itlaobing.eshopmanagement.controller;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.apache.commons.lang3.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;

/** 
 * ClassName: BaseController <br/> 
 * Function: TODO 功能描述 <br/> 
 * date: 2017年5月15日 下午12:02:01 <br/> 
 * 
 * @author Mmmmm 
 * @version  
 * @since JDK 1.8 
 */
public class BaseController {
	protected Log log = LogFactory.getLog(this.getClass());
	
	@Autowired
	private HttpServletRequest request;
	

	protected Map<String,String> buildPageRequestSearchFilter() {
		Map<String,String> param = new HashMap<>();
		Map<String, String[]> map = request.getParameterMap();
		// FIXME //同名多个参数
		for (Map.Entry<String, String[]> entry : map.entrySet()) {
			if (StringUtils.isNotBlank(entry.getValue()[0])) {
				param.put(entry.getKey(), entry.getValue()[0]);
			}
		}
		return param;
	}
	
}
